#include "guiterm.hpp"
#ifndef COMMANDPROMPT_HPP
#define COMMANDPROMPT_HPP
#include "ViewSegment.hpp"

class CommandPrompt
	:public ViewSegment
{
	Q_OBJECT
public:
	CommandPrompt(Session *handler, QWidget *parent=0);
	~CommandPrompt();
	
	void setPromptText(string text);
	void tabCompletionReceived(string prefix, string suffix);
	void reset();
	
	static QWidget *fakePrompt(string cmd);
	QWidget *frozenPrompt();
	void focus();
	void setCommand(string cmd, bool highlight=true);
	
	void setSelectedFiles(vector<string> fileNames);
	
protected slots:
	void onEnter();
	
protected:
	void tabComplete();
	
	Session *handler;
	CommandHistory *history;
	
	QLabel *prompt;
	CommandPromptEdit *inputBox;
	friend class CommandPromptEdit;
};

#endif
